import { ILoadMapTypeAll } from '@/common';
import { getLevelZeroJson, getSelectDataCommon, getTenantID } from '@/utils';

const ManageSearchColumns = (loadMdicMapList: Record<string, any>) => {
  /**
   * 数据字典
   * */
  const stateList = getSelectDataCommon(loadMdicMapList?.data?.obj?.[`${getTenantID()}${ILoadMapTypeAll.EXPERT_BUSINESSTYPE}`], 'name', 'id');

  return [
    {
      name: 'purchProjectName',
      placeholder: '采购项目名称',
      label: '采购项目名称',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'state',
      placeholder: '状态',
      label: '状态',
      componentType: 'Select',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
      dataSource: stateList,
    },
    {
      name: 'fullName',
      placeholder: '评标代表姓名',
      label: '评标代表姓名',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'companyName',
      placeholder: '工作单位名称',
      label: '工作单位名称',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },

    {
      name: 'createTime',
      placeholder: '创建',
      label: '',
      componentType: 'RangePicker',
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'createFormName',
      placeholder: '创建',
      label: '创建',
      componentType: 'DeptAndUser',
      dataSource: getLevelZeroJson() ?? [],
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: true, //是否放到更多搜索里面
      formOrgType: {
        COMP: 'createCompanyID',
        DEPT: 'createDepartmentID',
        POS: 'createPositionID',
        USER: 'createrID',
      },
    },
  ];
};

export { ManageSearchColumns };
